$(function(){
    $.fn.extend({
        showtime:function(){
            var today = new Date();
            var y = today.getFullYear();//年
            var m = today.getMonth()+1;//月
            var d = today.getDate();//日
            var h = today.getHours();//时
            var ms = today.getMinutes();//分
            var s = today.getSeconds();//秒
            var w = today.getDay();//周
            $('#time').html('当前时间：'+y+'-'+m+'-'+d+' '+''+h+':'+ms+':'+s+'&nbsp;周'+w);
            setTimeout('$(this).showtime()',100);
        }
    });
    $(this).showtime();
});
